package leetcode;




import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * create by duanx 2022/2/7
 *@classname: Test3
 *@author: duanx
 *@date: 2022/2/7 9:22
 **/
public class Test5 {

    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {
            String str;
            while (!(str = reader.readLine().toUpperCase()).isEmpty()){
                int num = Integer.parseInt(str);
                int n = (int)Math.sqrt(num);
                StringBuilder strBuilder = new StringBuilder();
                for (int i=2;i<=n;i++){
                    if (num%i==0){
                        strBuilder.append(i).append(" ");
                        num = num/i;
                        i--;
                    }
                }
                if (num>1){
                    strBuilder.append(num).append(" ");
                }
                System.out.println(strBuilder);
            }

        } catch (IOException e) {
            e.printStackTrace();
        }

    }


}
